package edu.sjsu.itack.util;

public class ITackException extends Exception {
	
	private static final long serialVersionUID = -4596248053832564642L;

	private String errorCode;
	
	public ITackException(String errorCode, Throwable e){
		super(e);
		this.errorCode = errorCode;
	}
	
	public ITackException(Throwable e, String errorCode, String... args){
		super(e);
		this.errorCode = errorCode;
	}
	
	public String getLocalizedMessage() {
		if (errorCode == null || errorCode.length() == 0)
			errorCode = "-1";
		return Messages.getMessage(errorCode);
	}
}
